import sys
import random

def f(n):
    r = 0
    for i in range(1,n):
        r =r+ 1/(i*(i+1))
    return  r

a=[100]
for i in range(9):
    a.append(random.randint(10,1000))
for i  in range(10):
    fin = open('{}.in'.format(i+1),'w')
    fout = open('{}.out'.format(i+1),'w')
    print(a[i],file=fin)
    print('{:.6f}'.format(f(a[i])),file=fout)
    fin.close()
    fout.close()
